package com.opgea.tutor.web.dto;

import com.opgea.tutor.domain.entities.Education;
import com.opgea.tutor.domain.interfaces.Marshallable;

public class EducationDTO implements Marshallable<Education> {

    private long id;
    private String schoolName;
    private String university;
    private String educationMedium;
    private String standard;
    private String subjects;

    public long getId() {
	return id;
    }

    public void setId(long id) {
	this.id = id;
    }

    public String getSchoolName() {
	return schoolName;
    }

    public void setSchoolName(String schoolName) {
	this.schoolName = schoolName;
    }

    public String getUniversity() {
	return university;
    }

    public void setUniversity(String university) {
	this.university = university;
    }

    public String getEducationMedium() {
	return educationMedium;
    }

    public void setEducationMedium(String educationMedium) {
	this.educationMedium = educationMedium;
    }

    public String getStandard() {
	return standard;
    }

    public void setStandard(String standard) {
	this.standard = standard;
    }

    public String getSubjects() {
	return subjects;
    }

    public void setSubjects(String subjects) {
	this.subjects = subjects;
    }

    @Override
    public void marshall(Education education) {
	this.id = education.getId();
	this.educationMedium = education.getEducationMedium();
	this.schoolName = education.getSchoolName();
	this.standard = education.getStandard();
	this.university = education.getUniversity();
	this.subjects = education.getSubjects();
    }

    @Override
    public Education unmarshall(Education education) {
	education.setId(this.id);
	education.setEducationMedium(this.educationMedium);
	education.setSchoolName(this.schoolName);
	education.setStandard(this.standard);
	education.setUniversity(this.university);
	education.setSubjects(this.subjects);
	return education;
    }

    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + (int) (id ^ (id >>> 32));
	return result;
    }

    @Override
    public boolean equals(Object obj) {
	if (this == obj)
	    return true;
	if (obj == null)
	    return false;
	if (getClass() != obj.getClass())
	    return false;
	EducationDTO other = (EducationDTO) obj;
	if (id != other.id)
	    return false;
	return true;
    }

    @Override
    public String toString() {
	return "EducationDTO [id=" + id + ", schoolName=" + schoolName
		+ ", university=" + university + ", educationMedium="
		+ educationMedium + ", standard=" + standard + ", subjects="
		+ subjects + "]";
    }

}
